#include"list.h"
#include<list>
int main()
{
	/*My::list<int> ans;
	ans.push_back(1);
	ans.push_back(2);
	ans.push_back(3);
	ans.push_back(4);
	ans.push_back(5);
	My::list<int>::iterator it1 = ans.begin();
	while (it1 != ans.end())
	{
		cout << *it1 << " ";
		++it1;
	}*/
	/*My::list<My::Pos> ans;
	ans.push_back(My::Pos(100,200));
	ans.push_back(My::Pos(100,200));
	My::list<My::Pos>::iterator it1 = ans.begin();
	while (it1 != ans.end())
	{
		cout << it1->_x << " " << it1->_y << endl;
		++it1;
	}
	cout << endl;*/
	My::list<int> ans;
	ans.push_back(1);
	ans.push_back(2);
	ans.push_back(3);
	ans.push_back(4);
	for (auto e : ans)
	{
		cout << e << " ";
	}
	cout << endl;
	ans.insert(ans.end(), 2);
	for (auto e : ans)
	{
		cout << e << " ";
	}
	cout << endl;
	My::list<int>::iterator it1 = ans.begin();


	while (it1 != ans.end())
	{
		cout << *it1 << " ";
		it1 = ans.erase(ans.begin());
	}
	/*list<int> ans1 = { 1,2,3 };
	ans1.erase(ans1.begin(),ans1.end());
	for (auto& e : ans1)
	{
		cout << e << " ";
	}*/
	return 0;
}
